package de.hszg.wjl.datacore.model;

import static org.junit.Assert.*;

import org.junit.Test;

public class TextQuestionTest extends QuestionTest<TextQuestion> {

	@Test
	public void testGetAwnser() {
		TextQuestion question = new TextQuestion();
		question.setAnswer("Tester");
		assertTrue(question.getAnswer().equals("Tester"));
	}

	@Test
	public void testXMLParsing() {
		TextQuestion question = createQuestion();
		assertTrue(question.getType() == QuestionType.TEXT);
		assertTrue(question.getID().equals("1"));
		assertTrue(question.isRequired());
		assertTrue(question.getText().equals("What's your name?"));
	}

	@Override
	protected String getQuestionXML() {
		return "<question type='text' required='true' id='1'><text>What's your name?</text></question>";

	}
}
